<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>求一组数中的所有数的和/平均值</title>
	</head>
	<body>
		<script>
		var arr = [10,20,30];
   
   var sum = 0;
   for(var i=0;i<arr.length;i++){
       sum += arr[i];
   }
   console.log(sum);
   var avg = sum/arr.length;
   console.log(avg);
</script>
	</body>
</html>
